package org.unei.multiprocessor.sharememory;

import org.unei.multiprocessor.ThreadID;

public class SafeBooleanMRSWRegister implements Register<Boolean>{

	boolean[] s_table;
	
	public SafeBooleanMRSWRegister(int capacity){
		s_table=new boolean[capacity];
	}
	
	@Override
	public Boolean read() {
		return s_table[ThreadID.get()];
	}

	@Override
	public void write(Boolean v) {
		for(int i=0;i<s_table.length;i++){
			s_table[i]=v;
		}
	}

}
